/** 协议签署路由 */
import Layout from '@/views/layout/Agreement'

const layout = function (meta = {}, path = '/agreement', requiresAuth = true) {
    return {
        path: path,
        component: Layout,
        meta: {
            requiresAuth: requiresAuth,
            ...meta
        }
    }
}

export default [
    {
        ...layout({
            permissions: ['agreement', 'sealSubject']
        }),
        children: [{
            path: 'Signature',
            component: () => import('@/views/admin/Agreement/signature'),
            meta: {
                title: '签章配置',
                icon: 'sealSubject'
            }
        },]
    },
    {
        ...layout({
            permissions: ['agreement', 'template']
        }),
        children: [{
            path: 'templateConfig',
            component: () => import('@/views/admin/Agreement/template-config'),
            meta: {
                title: '模板配置',
                permissions: ['agreement', 'template'],
                icon: 'template'
            }
        }]
    },

    {
        ...layout({
            permissions: ['agreement', 'sign']
        }),
        children: [{
            path: 'signingRecord',
            component: () => import('@/views/admin/Agreement/signing-record'),
            meta: {
                title: '签署记录',
                requiresAuth: true,
                permissions: ['agreement', 'sign'],
                icon: 'sign'
            }
        }]
    },

    // {
    //     ...layout({
    //         permissions: ['agreement'],
    //         title: '协议签署',
    //         icon: 'business'
    //     }),
    //     alwaysShow: true,
    //     children: [
    //         {
    //             path: 'Signature',
    //             component: () => import('@/views/admin/Agreement/signature'),
    //             meta: {
    //                 title: '签章配置',
    //                 requiresAuth: true,
    //                 permissions: ['agreement', 'sealSubject']
    //             }
    //         },
    //         {
    //             path: 'templateConfig',
    //             component: () => import('@/views/admin/Agreement/template-config'),
    //             meta: {
    //                 title: '模板配置',
    //                 requiresAuth: true,
    //                 permissions: ['agreement', 'template']
    //             }
    //         },
    //         {
    //             path: 'signingRecord',
    //             component: () => import('@/views/admin/Agreement/signing-record'),
    //             meta: {
    //                 title: '签署记录',
    //                 requiresAuth: true,
    //                 permissions: ['agreement', 'sign']
    //             }
    //         }
    //     ]
    // }
]